package com.bawei.live.view.adapter

import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
import androidx.recyclerview.widget.RecyclerView.Adapter
import com.bawei.image.ImgOptions
import com.bawei.image.LoadImageUtil
import com.bawei.live.databinding.CommonItemBinding
import com.bawei.live.databinding.PopleItemListBinding

/**
 * @Author: Lin Liu
 * @CreateTime: 2025年02月18日 17:55:06
 * @Description:
 */
class CommonAdapter constructor(private val list: List<String>) : RecyclerView.Adapter<CommonAdapter.ItemViewHolder>(){

    inner class ItemViewHolder(val dataBinding: CommonItemBinding) : RecyclerView.ViewHolder(dataBinding.root)

    override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ItemViewHolder {
        return ItemViewHolder(CommonItemBinding.inflate(LayoutInflater.from(parent.context),parent,false))
    }

    override fun getItemCount(): Int = list.size

    override fun onBindViewHolder(holder: ItemViewHolder, position: Int) {

        var entity = list[position]

        holder.dataBinding.commonItem.text = entity
    }

}